<template>
  <div>
    <router-view />
  </div>
</template>
<script setup >
import cache from '@/utils/cache'
import { useRouter } from '@/router';
import { ref, onMounted } from '@vue/composition-api'

const router = useRouter()
const theme = ref('default-theme')
onMounted(() => {
  setTheme()
  router.push('/details')
})

// 获取url以及主题缓存切换主题
const setTheme = () => {
  const { value = 1 } = cache.getCache('portal_type_is_inner') || {}
  if (parseInt(value) === 0) {
    theme.value = 'orange-theme'
  } else if (cache.getCache('theme')) {
    theme.value = cache.getCache('theme')
  }
  window.document.documentElement.setAttribute('data-theme', theme.value)
}

</script>

<style lang='scss'>
body {
  overflow: hidden;
  // background: #f5f7fa;
  font-family: Microsoft YaHei, Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: $--color-text-regular;
}
</style>
